#ifndef SLIMP_H
#define SLIMP_H

#include <vector>
#include <string>
#include <cstring>
#include <iostream>
#include <boost/smart_ptr.hpp>
#include <glibmm.h>

#ifdef WINDOWS
    #include <winsock.h>
#endif

#ifdef __WXGTK__
    #include <netdb.h>
    #include <sys/socket.h>
    #include <netinet/in.h>
    #include <arpa/inet.h>
    #include <unistd.h>
#endif

#include "Connection.h"
#include "Contact.h"
#include "Conversation.h"
#include "version.h"
#include "Client.h"
#include "MulticastSender.h"
#include "MulticastReceiver.h"

const std::string MULTICAST_ADDRESS = "239.255.0.1";
const std::string MULTICAST_PORT = "30001";
const short multicast_port = 30001;

class Slimp
{
    public:
        typedef boost::shared_ptr<Contact> ContactPtr;
        typedef boost::shared_ptr<Conversation> ConversationPtr;
        typedef boost::shared_ptr<Connection> ConnectionPtr;
        typedef boost::shared_ptr<Packet> PacketPtr;

    private:
        static const int MAX_HOSTNAME_LENGTH = 15;

    public:
        Slimp();
        Slimp(std::string ip, std::string port, std::string name);
        virtual ~Slimp();

    public:
        std::string getIP() const;
        std::string getPort() const;
        std::string getName() const;
        std::string getVersion() const;
        std::string getHostname() const;
        void sendAnnounce(PacketPtr announce) const;
        void receiveAnnounce(PacketPtr announce);
        void addContact(ContactPtr contact);
        void addConversation(ConversationPtr conversation);
        void addConnection(ConnectionPtr connection);

    protected:

    private:
        std::string listenPort;
        std::string listenIP;
        std::string userName;
        std::vector<ContactPtr> contactList;
        std::vector<ConversationPtr> conversationList;
        std::vector<ConnectionPtr> connectionList;
        sockaddr_in addr;
        hostent *host;
        char hostname[MAX_HOSTNAME_LENGTH];

    private:


};

#endif // SLIMP_H
